extends /templates/base

block content
  p
   span= "See "
   a(href="https://github.com/codecombat/codecombat/wiki/Diplomat-Home") GitHub
   span= " for instructions on how to translate."

  if ["codecombat.com", "www.ozaria.com"].indexOf(window.location.hostname) !== -1
   - let directLink = window.location.hostname === 'codecombat.com' ? 'https://direct.codecombat.com/i18n' : 'https://direct.ozaria.com/i18n'
   span= "To avoid CDN caching issues, we recommend using the "
   a(href=directLink)= directLink
   span= " direct link for submitting translations."

  if selectedLanguage
    .progress
      .progress-bar.progress-bar-info(role="progressbar" aria-valuenow=progress aria-valuemin="0" aria-valuemax="100" style="width: "+progress+"%")= progress+"%"
  
  table.table.table-condensed
    tr
      th
        select#language-select.form-control.input-sm
          option(value='') Select one...

      th Translated Name
      th Type
        select#type-select.form-control.input-sm
          option(value='') Select one...
      th= "Fully Translated (" + progress + "%)"
      if showGeneralCoverage
        th= "... Including Dialects (" + progressGeneral + "%)"

    if selectedLanguage
      for model in collection.models
        -var translatedName = ''
        -if (model.get('i18n') != undefined)
          -if (model.get('i18n').hasOwnProperty(selectedLanguage)) 
            -translatedName = model.get('i18n')[selectedLanguage].name

        tr
          td
            a(href=model.i18nURLBase+(model.get('slug') || model.id))= model.get('displayName') || model.get('name')
          td= translatedName
          td= model.constructor.className
          td(class=model.specificallyCovered ? 'success' : 'danger')= model.specificallyCovered ? 'Yes' : 'No'
          if showGeneralCoverage
            td(class=model.generallyCovered ? 'success' : 'danger')= model.generallyCovered ? 'Yes' : 'No'
